//
//  Viewdonghua.m
//  panduan
//
//  Created by rimi on 16/7/1.
//  Copyright © 2016年 hangge. All rights reserved.
//

#import "Viewdonghua.h"

@implementation Viewdonghua

+(void)shoppingCartView:(UIImageView *)btn2 {
    
    CAKeyframeAnimation *pasitionAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
    pasitionAnimation.duration = 0.5;
    pasitionAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    UIBezierPath* aPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(450, 700)
                                                         radius:400
                                                     startAngle:M_PI_2 * 3
                                                       endAngle:M_PI
                                                      clockwise:NO];
    pasitionAnimation.path = aPath.CGPath;
    pasitionAnimation.removedOnCompletion = NO;
    pasitionAnimation.fillMode = kCAFillModeForwards;
    [btn2.layer addAnimation:pasitionAnimation forKey:@"position"];
    [UIView animateWithDuration:0.25 animations:^{
        btn2.bounds = CGRectMake(0, 0, 80, 80);
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.25 animations:^{
            btn2.bounds = CGRectMake(0, 0, 40, 40);
        } completion:^(BOOL finished) {
            [btn2 removeFromSuperview];
        }];
    }];
}

@end
